package com.itbaiwei.testday01.day01.annotation;

import java.util.Scanner;

/**
 * Class: Main
 * Description:
 * Author: haijun.xu
 * Date: 2025/4/24 20:15
 */

enum WeekDay{
    day01,day02, day03,day04,day05,day06, day07;
    public String getChineseName(){
          switch (this){
              case day01:
                  return "星期一";
              case day02:
                  return "星期二";
              case day03:
                  return "星期三";
              case day04:
                  return "星期四";
              case day05:
                  return "星期五";
              case day06:
                  return "星期六";
              case day07:
                  return "周日";
              default:
                  return "输入不合法";
          }
    }

}


public class Main {

    public static void main(String[] args) {
        System.out.println("查询星期日期系统");
        while (true){
            System.out.println("请输入指令，0，是查看，非0是退出");
            Scanner scanner=new Scanner(System.in);
            int a = scanner.nextInt();
            if(a==0){
                System.out.println("请输入星期号码");
                Scanner scanner1=new Scanner(System.in);
                String next = scanner1.next();
                WeekDay weekDay = WeekDay.valueOf(next);
                String chineseName = weekDay.getChineseName();
                System.out.println(chineseName);
            }else{
                System.exit(0);
            }


        }


    }

}
